<template>
  <div class="contentWeb clear">
    <div class="member_menu">
      <Companyleft active=""/>
    </div>
    <div class="member_right ">
      <div class="personTengt">
        <div class="comtops clear">
          <div class="logo">
            <img :src="info.logo">
          </div>
          <div class="comnames">
            <h2>{{info.name}}</h2>
            <div class="desc">
              <span>{{info.industry}}</span>
              <span>{{info.enterpriseNature}}</span>
              <span>{{info.companySize}}</span>
            </div>
            <div class="address">{{info.addressDetail}}</div>
          </div>
          <div class="rsub" @click="add"><i class="el-icon-edit"></i> 编辑</div>
        </div>
        <div class="comtops clear">
          <el-row>
            <el-col :span="4"><span>企业简称：</span></el-col>
            <el-col :span="8">{{info.nickname}}</el-col>
            <el-col :span="4"><span>招聘联系人：</span></el-col>
            <el-col :span="8">{{info.contacts}}</el-col>

          </el-row>
          <el-row>
            <el-col :span="4"><span>统一社会信用代码：</span></el-col>
            <el-col :span="8">{{info.sociologyCreditCode}}</el-col>
            <el-col :span="4"><span>身份证号：</span></el-col>
            <el-col :span="8">{{info.identifyCode}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>所属行业：</span></el-col>
            <el-col :span="8">{{info.industry}}</el-col>
            <el-col :span="4"><span>手机号：</span></el-col>
            <el-col :span="8">{{info.mobileNum}}</el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>企业性质：</span></el-col>
            <el-col :span="8">{{info.enterpriseNature}}</el-col>
            <el-col :span="4"><span>电子邮箱：</span></el-col>
            <el-col :span="8">{{info.email}}</el-col>
          </el-row>
        </div>
        <div class="comtops clear">
          <el-row>
            <el-col :span="4"><span>企业介绍：</span></el-col>
            <el-col :span="20" v-html="info.introduction">
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>企业福利：</span></el-col>
            <el-col :span="20">
              <el-button v-if="!fuli.length" style="background: #20a2b2; width: 100px; border: 0;"
                         type="primary"
                         @click="add">去完善
              </el-button>
              <el-tag type="warning" style="margin-right: 15px;" v-for="(item, index) in fuli" :key="index">{{item}}</el-tag>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>工作时间：</span></el-col>
            <el-col :span="20">
              <el-button v-if="!info.startWorkTime || !info.endWorkTime" style="background: #20a2b2; width: 100px; border: 0;"
                         type="primary"
                         @click="add">去完善
              </el-button>
              <span>{{info.startWorkTime}}-{{info.endWorkTime}}</span></el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>经办人身份证明：</span></el-col>
            <el-col :span="20">
              <img :src="info.jbrsfzm" style="height: 100px;">
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>用人单位委托证明：</span></el-col>
            <el-col :span="20">
              <img :src="info.yrdwwtzm" style="height: 100px;">
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>营业执照：</span></el-col>
            <el-col :span="20">
              <img :src="info.businessLicenseUrl" style="height: 100px;">
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4"><span>企业法人身份证：</span></el-col>
            <el-col :span="20">
              <img :src="info.sfzZm" style="height: 100px;">
              <img :src="info.sfzFm" style="height: 100px;">
            </el-col>
          </el-row>
        </div>
        <div class="comtops clear">
          <el-row>
            <el-col :span="4"><span>企业相册：</span></el-col>
            <el-col :span="20">
              <el-button v-if="!info.contentSet || !info.contentSet.length" style="background: #20a2b2; width: 100px; border: 0;"
                         type="primary"
                         @click="add">去完善
              </el-button>
            <div class="clear">
              <img :src="item.imageUrl" height="100px" style="float: left; margin-right: 10px;" v-for="(item, index) in info.contentSet" :key="index">
            </div>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
  </div>
</template>
<script type="text/babel">
// @ is an alias to /src
import Upload from '../../components/upload'
import Companyleft from '../../components/companyleft'
import { EnterpriseInfo } from '../../assets/js/domains'
import mt from '../../assets/img/mt.png'

import moment from 'moment'
export default {
  name: 'PersonInfo',
  components: { Companyleft, Upload },
  directives: {},
  data: function () {
    return {
      mt: mt,
      fuli: [],
      enterprise_id: 0,
      info: {},
      uplaodstyle: { width: '120px', height: '160px' }
    }
  },
  created: function () {
    document.documentElement.scrollTop = document.body.scrollTop = 0
  },
  computed: {},
  mounted: function () {
    this.enterprise_id = localStorage.getItem('md_user_uid')
    this.getEnterpriseInfo()
  },
  methods: {
    add: function () {
      this.$router.push({ path: '/addInfo' })
    },
    onSubmit: function () {
    },
    getEnterpriseInfo: function () {
      const _this = this
      EnterpriseInfo({ enterprise_id: this.enterprise_id }).then(function (res) {
        if (res.code === 200) {
          _this.info = res.data
          // _this.info.startWorkTime = moment(_this.info.startWorkTime).format("HH:mm")
          // _this.info.endWorkTime = moment(_this.info.endWorkTime).format("HH:mm")
          // res.data.treatment = null
          res.data.treatment && (_this.fuli = res.data.treatment.split(',').filter(item => !!item.trim()))
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
  @import "../../assets/css/member";
</style>
